<template>
<div>
    <el-breadcrumb separator="/">
         <el-breadcrumb-item >个人中心</el-breadcrumb-item>
  
    </el-breadcrumb>
    
<el-row class="margintop20">
            <el-col :span="8" >
                  <el-form 
                  label-position="rigth" 
                  label-width="80px" 
                  :model="form">
                    <el-form-item label="姓名">
                      <el-input v-model="form.name"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号码">
                      <el-input v-model="form.region"></el-input>
                    </el-form-item>
                    <el-form-item label="邮箱">
                      <el-input v-model="form.mall"></el-input>
                    </el-form-item>
                      <el-form-item label="QQ号码">
                      <el-input v-model="form.qqnum"></el-input>
                    </el-form-item>
                      <el-form-item label="校区" prop="category">
                        <el-cascader
                                style="width:100%"
                                v-model="form.category"
                                :options="options"
                                @change="handleChange"></el-cascader>
                        
                    </el-form-item>
                      <el-form-item label="学科" prop="category1">
                      <el-cascader
                                style="width:100%"
                                v-model="form.category1"
                                :options="options1"
                                @change="handleChange1"></el-cascader>
                    </el-form-item>
                      <el-form-item label="班级" prop="category2">
                      <el-cascader
                                style="width:100%"
                                v-model="form.category2"
                                :options="options2"
                                @change="handleChange2"></el-cascader>
                    </el-form-item>
                      <el-form-item>
                      <el-button type="primary" @click="submitForm">提交修改</el-button>
                      <el-button type="success" @click="resetForm('ruleForm')">修改密码</el-button>
                    </el-form-item>
                  </el-form>
            </el-col>
</el-row>

</div>
    

</template>


<script>
import {xiaoqucatetory,xuekecatetory,banjicatetory} from "@/utils"

import {updategeren} from "@/api"
  export default {
    data() {
      return {
        labelPosition: 'left',
        form: {},
        options:xiaoqucatetory,
        options1:xuekecatetory,
        options2:banjicatetory,
      };
    },
    methods:{
      submitForm(){
            this.form.category = this.form.category.join(",")
            this.form.category1 = this.form.category1.join(",")
            this.form.category2 = this.form.category2.join(",")

            updategeren(
                this.form
            )
            .then(res=>{
                if(res.type){
                    // this.$router.push({name:"wodexm"})
                }
            })
            .catch(err=>{

            })
            console.log(this.form)
      },  

      handleChange(){

      },
      handleChange1(){
        
      },
      handleChange2(){

      }
    },
    mounted(){
      // console.log(this.form)
    }
  }
</script>